<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login.html', "IndexController@login");//登陆页面

Route::any('/Admin/login', 'AdminController@login');//登陆逻辑
Route::any('/Admin/logout', 'AdminController@logout');//退出账号

Route::middleware(['CheckLogin'])->group(function () {
    Route::get('/', 'IndexController@index');//首页
    Route::get('/welcome.html', 'IndexController@welcome');//我的桌面

    //资讯管理
    Route::any('/Article/list.html', 'ArticleController@_list');
    Route::any('/Article/edit.html', 'ArticleController@edit');
    Route::any('/Article/del', 'ArticleController@del');
    Route::any('/Article/uploadImg', 'ArticleController@uploadImg');

    //资讯分类
    Route::any('/ArticleCategory/list.html', 'ArticleCategoryController@_list');
    Route::any('/ArticleCategory/edit.html', 'ArticleCategoryController@edit');
    Route::any('/ArticleCategory/del', 'ArticleCategoryController@del');
    Route::any('/ArticleCategory/uploadImg', 'ArticleCategoryController@uploadImg');

    //管理员
    Route::any('/Admin/list.html', 'AdminController@_list');
    Route::any('/Admin/edit.html', 'AdminController@edit');
    Route::any('/Admin/del', 'AdminController@del');

    //系统设置
    Route::any('/System/SiteInfo.html', 'SiteInfoController@edit');

    //商品分类管理
    Route::any('/GoodsCategory/list.html', 'GoodsCategoryController@_list');
    Route::any('/GoodsCategory/edit.html', 'GoodsCategoryController@edit');
    Route::any('/GoodsCategory/del', 'GoodsCategoryController@del');
    Route::any('/GoodsCategory/uploadImg', 'GoodsCategoryController@uploadImg');

    //品牌管理
    Route::any('/Brand/list.html', 'BrandController@_list');
    Route::any('/Brand/edit.html', 'BrandController@edit');
    Route::any('/Brand/del', 'BrandController@del');
    Route::any('/Brand/uploadImg', 'BrandController@uploadImg');
    Route::any('/Brand/getBrandListByGoodsCatId', 'BrandController@getBrandListByGoodsCatId');//根据分类ID获取品牌列表

    //商品管理
    Route::any('/Goods/list.html', 'GoodsController@_list');
    Route::any('/Goods/edit.html', 'GoodsController@edit');
    Route::any('/Goods/del', 'GoodsController@del');
    Route::any('/Goods/uploadImg', 'GoodsController@uploadImg');
    Route::any('/Goods/uploadLogo', 'GoodsController@uploadLogo');
    Route::any('/GoodsCategoryAttr/getAttrsByCatId', 'GoodsCategoryAttrController@getAttrsByCatId');

    //通用
    Route::any('/uploadImage', 'ToolController@uploadImage');//上传图片

});
